<?php
	class numeroService
	{
		private $model;
		private $id=2;
		public function numeroService(){
			
			$this->model=Numero::model()->findByPK($this->id);
		}
		
		public function nextFacturaA()
		{
			return $this->model->nFacturaA+1;
		}
		
		public function nextFacturaB()
		{
			return $this->model->nFacturaB+1;
		}
		
		public function updateFacturaA()
		{
			$this->model->nFacturaA = $this->model->nFacturaA+1;
			$this->model->save();
		}
		public function updateFacturaB()
		{
			$this->model->nFacturaB = $this->model->nFacturaB+1;
			$this->model->save();
		}
		public function nextNotaA()
		{
			return 	$this->model->nCreditoA+1;
		}
		public function nextNotaB()
		{
			return $this->model->nCreditoB+1;
		}
		public function updateNotaA()
		{
			$this->model->nCreditoA = $this->model->nCreditoA+1;
			$this->model->save();
		}
		public function updateNotaB()
		{
			$this->model->nCreditoB = $this->model->nCreditoB+1;
			$this->model->save();
		}
		public function getFechaCierre()
		{
			return $this->model->fecha_cierre;
		}
		
	}
?>